/**
 * 
 */
package com.wubo.sec.acl;

import com.wubo.sec.SecurityManager;
import com.wubo.sec.acl.core.AclManager;
import com.wubo.sec.acl.core.EntityAcl;
import com.wubo.sec.model.Authority;

/**
 * @author WuBo
 * @CreateDate 2012-4-23
 */
public class AuthAcl extends EntityAcl {
	private Authority auth;
	public AuthAcl(Authority auth){
		this.auth = auth;
	}
	
	@Override
	public int getAcl() {
		if(SecurityManager.isAdmin()){
			return AclManager.getInstance().getAllAcl();
		}
		if(! auth.isLocked()){
			return AclManager.getInstance().getAllAcl();
		}
		return 0;
	}
	
}
